﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Master.Master"
    Inherits="System.Web.Mvc.ViewPage<List<OrderEntity>>" %>

<%@ Import Namespace="xTeam.HengLe.Enums" %>
<%@ Import Namespace="xTeam.Hengle.Helper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <ul class="stateUl">
    <li><a href="<%=Url.Action("WaitProcessOrders", "Order", new { orderState =(int)OrderState.All})%>">
            所有</a></li>
        <li><a href="<%=Url.Action("WaitProcessOrders", "Order", new { orderState =(int)OrderState.UnPay})%>">
            未支付</a></li>
        <li><a href="<%=Url.Action("WaitProcessOrders", "Order", new { orderState =(int)OrderState.WAIT_BUYER_PAY})%>">
            未支付成功</a></li>
        <li><a href="<%=Url.Action("WaitProcessOrders", "Order", new { orderState =(int)OrderState.WAIT_SELLER_SEND_GOODS})%>">
            等待卖家发货</a></li>
        <li><a href="<%=Url.Action("WaitProcessOrders", "Order", new { orderState =(int)OrderState.WAIT_BUYER_CONFIRM_GOODS})%>">
            等待买家确认收货</a></li>
        <li><a href="<%=Url.Action("WaitProcessOrders", "Order", new { orderState =(int)OrderState.TRADE_FINISHED})%>">
            完成</a></li>
    </ul>
    <div style="clear:both;"></div>
    <form id="stateForm" name="stateForm">
    <ul class="stateUl">
        <li>订单号:<input type="text" name="orderId" id="orderId" />
            <input type="submit" name="btnSubmit" id="btnSubmit" value="Search" />
        </li>
    </ul>
    </form>
    <table class="gv textCenter">
        <thead class="title ">
            <tr>
                <td class="textLeft width150">
                    订单ID
                </td>
                <td class="width100">
                    金额
                </td>
                <td class="width100">
                    数量
                </td>
                <td class="width100">
                    状态
                </td>
                <td class="width150">
                    加入时间
                </td>
                <td class="textLeft">
                    操作
                </td>
            </tr>
        </thead>
        <tbody>
            <%
                foreach (OrderEntity item in Model)
                {
            %>
            <tr>
                <td class="textLeft">
                    <%= Html.ActionLink(item.OrderId , "SaleView" , new { orderId = item.OrderId , uid = item.Uid })%>
                </td>
                <td>
                    <%= item.Price.ToString("0.00") %>
                </td>
                <td>
                    <%= item.Count %>
                </td>
                <td>
                    <%= string.Format("<div class='orderState orderState_{0}'>{1}</div>", item.State, StringExtendFun.OrderStateForManage(item.State))%>
                </td>
                <td>
                    <%=item.AddDate %>
                </td>
                <td class="textLeft">
                    <input type="button" name="btnView" value="查看" />
                    <input type="button" name="btnDel" value="删除" />
                    <%= Html.Hidden("OrderId" , item.OrderId , new {id=Guid.NewGuid() })%>
                    <%= Html.Hidden("Uid" , item.Uid , new {id=Guid.NewGuid() })%>
                </td>
            </tr>
            <%
                }
            
            %>
        </tbody>
    </table>
    <div class="btnBar ">
        <div class="btnBarLeft ">
            <div class="divPager2">
                <%= Html.Pager(ViewData["Pager"]) %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cssLink" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="jsLink" runat="server">
    <script src="<%=Url.Content("~/Scripts/Manage/Order.js") %>" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cssContent" runat="server">
    <style type="text/css">
        .stateUl li
        {
            margin: 10px;
            float: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="jsContent" runat="server">
    <script type="text/javascript">
        $(function () {
            OrderList.PreViewUrl = '<%=Url.Action("SaleView") %>'
            OrderList.DeleteUrl = '<%= Url.Action("SaleItemDelete") %>';

            OrderList.Init();
        });
    </script>
</asp:Content>
